# -*- coding: utf-8 -*-
# https://blog.csdn.net/djstavaV/article/details/112261899

from tenacity import retry, stop_after_attempt


@retry(stop=stop_after_attempt(3))
def task():
    print("task running ... ")
    raise Exception


task()